# -- coding: utf-8 --
import crypt

def testpass(cryptPass):
    salt = cryptPass[0:2]

    dictfile = open('dic.txt','r')
    for i in dictfile.readline():
        word = i.strip('\n')
        crypt_w = crypt.crypt(word,salt)
        if (crypt_w == cryptPass):
            print('[+] Found Password:' + word)
            return
        else:
            print('[-] Password not Found.')
            return

def main():
    passfile = open('password.txt','r')
    for line in passfile.readline():
        if ':' in line :
            user =  line.strip(':')[0]
            cryptpass = line.strip(':')[1].strip(' ')
            print('[+] Checking Password For:'+ user,testpass(cryptpass))

if __name__ == '__main__':
    main()

